﻿using System;
using System.Reflection;

public class Person
{
    // 无参构造 
    public Person() => Console.WriteLine("无参构造");

    // 带参构造 
    public Person(string name) : this()
        => Console.WriteLine($"单参构造，姓名：{name}");

    // 全参构造 
    public Person(string name, int age) : this(name)
        => Console.WriteLine($"双参构造，年龄：{age}");
}

class Program
{
    static void Main()
    {

        var obj1 = (Person)Activator.CreateInstance(typeof(Person));

        Type type = typeof(Person);
        ConstructorInfo ctor = type.GetConstructor(new[] { typeof(string), typeof(int) });
        var obj2 = (Person)ctor.Invoke(new object[] { "张三", 25 });
        Console.ReadLine();
    }
}